package kr.co.doriclassic.ifelse;

public class FruitShop {
	private int iProduct;
	
	public FruitShop() {
		
	}

	public FruitShop(int iProduct) {
		super();
		this.iProduct = iProduct;
	}
	
	public double accDiscount(){
		if(iProduct>=100){
			return iProduct*(100*0.8);
		}
		else { 
			if(iProduct>=20){
				return iProduct*(100*0.85);
			}
			else {
				if(iProduct>=10){
						return iProduct*(100*0.9);
				}
				else 
					return iProduct*100;	
			}
		}
		
	}

	@Override
	public String toString() {
		return "물건의 할인된 가격은 " + accDiscount() + "원 입니다.";
	}

		
	
}
